<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <script type="text/javascript" src="vue.js"></script>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <!-- 引入组件库 -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>


</head>
<body>
<div id="app">
    <div>
        <el-input type="date" v-model="sendInfo.mindate" placeholder="最早日期" style="display: inline-block; width: 200px;"></el-input>
        <el-input type="date" v-model="sendInfo.maxdate" placeholder="最晚日期" style="display: inline-block; width: 200px;"></el-input>
        <el-button icon="el-icon-search" circle @click="searchData()"></el-button>

    </div>
    <template>
        <el-table
                :data="info"
                stripe
                style="width: 100%">
            <el-table-column
                    prop="id"
                    label="编号"
                    width="220">
            </el-table-column>
            <el-table-column
                    prop="store.sname"
                    label="审查店铺"
                    width="240">
            </el-table-column>
            <el-table-column
                    prop="checkman"
                    label="审查人"
                    width="230">
            </el-table-column>
            <el-table-column
                    prop="checkdate"
                    label="审查时间"
                    width="245">
            </el-table-column>
            <el-table-column
                    prop="storeState.state"
                    label="审查结果"
                    width="240">
            </el-table-column>
            <el-table-column
                    fixed="right"
                    label="操作">
                <template slot-scope="scope">
                    <el-button type="primary" @click="check(scope.row.id)">查看原因</el-button>
                </template>
            </el-table-column>
        </el-table>

        <el-pagination @current-change="handleCurrentChange" background layout="prev, pager, next" :total="sendNumberAll">
        </el-pagination>

        <el-dialog title="查看原因" :visible.sync="checkNotifyVisible" width="30%" center>
            <el-form :model="CTinfo" status-icon :rules="rules" ref="CTinfo" label-width="100px"
                     class="demo-ruleForm">
                <span>原因</span>
                <el-input
                        type="textarea"
                        :rows="2"
                        v-model="CTinfo.other" readonly="readonly">
                </el-input>
            </el-form>
            <span slot="footer" class="dialog-footer">
                <el-button @click="checkNotifyVisible=false">确 定</el-button>
            </span>
        </el-dialog>
    </template>


</div>


<script>

    var app = new Vue({
        el: "#app",
        data:{
            textarea: '',
            info:[],
            CTinfo:{},
            roleArr:[],
            sendInfo:{},
            updateStateONE:{},
            sendNumberAll:0,
            checkNotifyVisible:false

        },
        methods:{
            handleCurrentChange:function(val) {
                getInfo(val,10);
            },
            searchData:function(){
                getInfo(1,10);
            },
            check:function (b) {
                app.updateStateONE.id = b;
                $.get("/cai/check/listOther/"+b,function (backData) {
                    app.CTinfo = backData.data;
                });
                app.checkNotifyVisible = true;
            },
        }
    });
    function getInfo(a, b) {
        app.sendInfo.pageNo = a;
        app.sendInfo.pageCount = b;

        $.post("/cai/check/list",app.sendInfo,function (backData) {
            app.info=backData.data.empListAll;
            app.sendNumberAll=backData.data.empNumber;
        });
    }
    getInfo(1, 10);
</script>
</body>
</html>
